// import axios from "axios";
import service from "@/utils/request.js";

// 新增用户
export const createUser = (data) => {
  return service({
    method: "post",
    url: "/createUser",
    data,
    headers: {
      "Content-Type": "application/json",
    },
  });
};

// 删除用户
export const delUser = (data) => {
  return service({
    method: "post",
    url: "/delUser",
    data,
    headers: {
      "Content-Type": "application/json",
    },
  });
};

// 修改用户
export const updateUser = (data) => {
  return service({
    method: "post",
    url: "/updateUser",
    data,
    headers: {
      "Content-Type": "application/json",
    },
  });
};

// 查询用户
export const selectUser = (data) => {
  return service({
    method: "post",
    url: "/selectUser",
    data,
    headers: {
      "Content-Type": "application/json",
    },
  });
};

// 获取用户表枚举值
export const userEnumValue = (data) => {
  return service({
    method: "post",
    url: "/userEnumValue",
    data,
    headers: {
      "Content-Type": "application/json",
    },
  });
};

// 发送验证码
export const sendMsg = (data) => {
  return service({
    method: "post",
    url: "/send_sms",
    data,
    headers: {
      "Content-Type": "application/json",
    },
  });
};

// 登录
export const loginApi = (data) => {
  return service({
    method: "post",
    url: "/check_sms",
    data,
    headers: {
      "Content-Type": "application/json",
    },
  });
};
